package com.o.mj.controller;

import com.github.pagehelper.PageInfo;
import com.o.mj.pojo.UserInfo;
import com.o.mj.service.StudyHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;

/**
 * 页面转跳相关
 */

@Controller
public class WebController {

    @Autowired
    StudyHomeService studyHomeService;
    /**
     * 登录页面
     */
    @RequestMapping("/index")
    public String index() {
        return "pages_login";
    }

    /**
     * 注册
     */
    @RequestMapping("/registerL")
    public String registerL() {
        return "pages_register";
    }

    /**
     * 忘记密码
     */
    @RequestMapping("/forgetL")
    public String forgetL() {
        return "pages_forget";
    }

    //数学待业
    @RequestMapping("/dw")
    public String dw(HttpServletRequest request, @RequestParam(name = "pageNum", defaultValue = "1") int pageNum) {
        PageInfo<UserInfo> pageInfo = studyHomeService.getMatch(pageNum, 10);
        request.setAttribute("pageInfo", pageInfo);
        request.setAttribute("pageInfo", pageInfo);
        return "docM_watting";
    }

    //数学统计
    @RequestMapping("/chartMJs")
    public String chartMJs() {
        return "js_chartjs";
    }

    //外国语
    @RequestMapping("/docE")
    public String docE() {
        return "pages_docE";
    }

    //汉语言
    @RequestMapping("/docH")
    public String docH() {
        return "pages_docH";
    }

    //化工
    @RequestMapping("/docHg")
    public String docHg() {
        return "pages_docHg";
    }

    //经管
    @RequestMapping("/docJ")
    public String docJ() {
        return "pages_docJ";
    }

    //物理
    @RequestMapping("/docW")
    public String docW() {
        return "pages_docW";
    }

    //校企合作
    @RequestMapping("/docXiaoqi")
    public String docXiaoqi() {
        return "pages_docXiaoqi";
    }

    //非校企合作
    @RequestMapping("/docQita")
    public String docQita() {
        return "pages_docQita";
    }

    //公务员
    @RequestMapping("/docGongwu")
    public String docGongwu() {
        return "pages_docGongwu";
    }

    //研究生
    @RequestMapping("/docYanjiu")
    public String docYanjiu() {
        return "pages_docYanjiu";
    }

    //待业人员
    @RequestMapping("/docWatting")
    public String docWatting() {
        return "pages_docWatting";
    }

    //消息通知
    @RequestMapping("/messageUi")
    public String messageUi() {
        return "ui_buttons";
    }

    //修改校企合作
    @RequestMapping("/uiCards")
    public String uiCards() {
        return "ui_cards";
    }

    //查看校企合作
    @RequestMapping("/uiOther")
    public String uiOther() {
        return "ui_other";
    }

    //删除角色
    @RequestMapping("/confirm")
    public String confirm() {
        return "js_jconfirm";
    }

    //提升管理员
    @RequestMapping("/ag")
    public String ag() {
        return "ag";
    }

}
